﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VINETLIFE.DO;
using VINETLIFE.BL;
using System.Web.UI.WebControls;
using VINETLIFE.AdminCP;

namespace VINETLIFE.Module
{
    
    public partial class ucFooter : System.Web.UI.UserControl
    {
        cmsSendEmailDO objSendMail = new cmsSendEmailDO();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rptHuongDanMuaHangDataSource();
                rptChinhSachDataSource();
                rptVinetlifeDataSource();
                rptLienMinhDataSource();
                ltrContactFooter.Text = new sysConfigBL().Select(new sysConfigDO() { ConfigID = 29 }).ConfigValue;
            }
        }

        //private void rptTagDataSource()
        //{
        //    rptTag.DataSource = new cmsTagBL().GetByType(0, 2);
        //    rptTag.DataBind();
        //}
        protected void rptVinetlifeDataSource()
        {
            rptVinetlife.DataSource = new cmsCategoryBL().SelectByParent(25);
            rptVinetlife.DataBind();
        }
        protected void rptLienMinhDataSource()
        {
            rptLienMinh.DataSource = new cmsCategoryBL().SelectByParent(35);
            rptLienMinh.DataBind();
        }
        private void rptHuongDanMuaHangDataSource()
        {
            rptHuongDanMuaHang.DataSource = new cmsCategoryBL().SelectByParent(5);
            rptHuongDanMuaHang.DataBind();
        }
        private void rptChinhSachDataSource()
        {
            rptChinhSach.DataSource = new cmsCategoryBL().SelectByParent(10);
            rptChinhSach.DataBind();
        }
        protected string FriendlyUrl(string strTitle)
        {
            return Ultility.Change_AV(strTitle);
        }
        //protected void btnGui_Click(object sender, EventArgs e)
        //{
        //    if (txtEmail.Text != "")
        //    {
        //        objSendMail.Email = txtEmail.Text.Trim();
        //    }
        //    else 
        //    {
        //        objSendMail.Email = txtSendEmail.Text.Trim();
        //    }
        //        objSendMail.DateRegister = DateTime.Now;
        //        objSendMail.IsEnabled = false;
            
        //        new cmsSendEmailBL().Insert(objSendMail);
        //        Functions.Alert("Đăng ký thành công!",txtEmail.Text="");
           
        //}
    }
}